var MyQueue = function() {
    this.start = []
    this.end = []
};

/** 
 * @param {number} x
 * @return {void}
 */
MyQueue.prototype.push = function(x) {
    this.start.push(x)
};

/**
 * @return {number}
 */
MyQueue.prototype.pop = function() {
    if(this.end.length<=0){
        while(this.start.length){
            this.end.push(this.start.pop())
        }
    }
    return this.end.pop()
};

/**
 * @return {number}
 */
MyQueue.prototype.peek = function() {
        if(this.end.length<=0){
        while(this.start.length){
            this.end.push(this.start.pop())
        }
    }
    return this.end[this.end.length-1]
};

/**
 * @return {boolean}
 */
MyQueue.prototype.empty = function() {
    if(this.end.length==0&&this.start.length==0){
        return true
    }else{
        return false
    }
};